package com.lagou.mongosharding;

import com.lagou.mongosharding.entity.Resume;
import com.lagou.mongosharding.repository.ResumeRepository;
import java.util.List;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class MongoShardingApplication {

  public static void main(String[] args) {
    ConfigurableApplicationContext run = SpringApplication
        .run(MongoShardingApplication.class, args);
    ResumeRepository bean = run.getBean(ResumeRepository.class);
    Resume updateresume = new Resume();
    updateresume.setName("liujiao2222");
    updateresume.setSalary("800000");
    bean.insert(updateresume);
    List<Resume> all = bean.findAll();
    for (Resume resume : all) {
      System.out.println(resume);
    }
  }

}
